package cn.persistenceCollection.demos;

import cn.persistenceCollection.JdkSerializer;
import cn.persistenceCollection.PersistenceContext;

import java.io.Serializable;
import java.util.Map;

public class MapDemo {

    static class SessionHolder{
        static class Session implements Serializable {

        }
        PersistenceContext persistenceContext = new PersistenceContext(".");
        Map<String, Session> sessionMap = persistenceContext.openMap("session",new JdkSerializer<>(String.class),new JdkSerializer<>(Session.class),1000);
        public Session getBySessionId(String sessionId){
            return sessionMap.get(sessionId);
        }
        public void putSession(String sessionId, Session session){
            sessionMap.put(sessionId,session);
        }

    }

    public static void main(String[] args) {



    }
}
